package 设计模式.观察者模式.improve;

public class BaiduSite implements Observer{
    //温度，气压，适度
    private float temperature;
    private float pressure;
    private float humidity;

    //更新天气情况，是由WeatherData来调用
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    public void display() {
        System.out.println("***百度 mTemperature:" + temperature + "***");
        System.out.println("***百度 mPressure:" + pressure + "***");
        System.out.println("***百度 mHumidity:" + humidity + "***");
    }
}
